package com.ws.haungjia.mapper;

import com.ws.haungjia.Bean.*;
import lombok.Data;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface LvxingMapper {

    List<luxian> cha();

    @Select("select * from luyou")
    List<luxian> qiancha();

    @Insert("insert into luyou(PackageID,Fid,name,tianshu,jiage,renshu,zhuangtai,sid,zhutu,chufadi,mdidi) values(#{packageID},#{fid},#{name},#{tianshu},#{jiage},#{renshu},#{zhuangtai},#{sid},#{zhutu},#{chufadi},#{mdidi})")
    int add(luxian luxian);

    @Select("select * from fenlei")
    List<Fenlie> chafenlie();

    @Select("select * from shangjia")
    List<Shangjia> chashangjia();

    @Delete("delete from luyou where PackageID=#{id}")
    int shan(int id);

    @Select("select *from luyou where PackageID=#{id}")
    luxian huixina(int id);
    //修改
    @Update("update luyou set  Fid=#{fid},name=#{name},mdidi=#{mdidi},tianshu=#{tianshu},jiage=#{jiage},renshu=#{renshu},zhuangtai=#{zhuangtai},sid=#{sid},zhutu=#{zhutu},chufadi=#{chufadi} where PackageID=#{packageID}")
    int xiugai(luxian luxian);


//    模糊查询
     List<luxian> sousuo(Luxianhuixian luxianhuixian);



//     轮播方法
     List<Lunbo> luncha();

     @Insert("insert into lunbo(PackageID,tupian) values(#{packageID},#{zhutu})")
     int lunzeng(luxian luxian);

    @Select("select *from luyou where PackageID=#{id}")
    luxian lunhui(int id);

    @Delete("delete from lunbo where Lid=#{id}")
    int lunshan(int id);


    //     附属图
    List<Fushutu> fushucha(@Param("id") int id);

    @Insert("insert into fushutu(PackageID,tupian) values(#{packageID},#{tupian})")
    int fushuzeng(Fushutu fushutu);

    @Delete("delete from fushutu where Tid=#{id}")
    int fushushan(int id);

//前后
    Fushutu xiangxicha(@Param("packageID") int packageID);

    luxian lushang(@Param("packageID") int packageID);
}
